package HomeWork;

public class Demo9 {
    public static void main(String[] args) {
        Thread thread = new Thread(new HelloWorldTask());
        thread.start();
    }
}

class HelloWorldTask implements Runnable {
    private int count = 0;

    @Override
    public void run() {
        while (count < 10) {
            System.out.println("hello world");
            count++;
            try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("结束");
    }
}
